<!DOCTYPE html>
<html>
    <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta charset="utf-8">
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="black" name="apple-mobile-web-app-status-bar-style">
        <meta content="telephone=no" name="format-detection">
        <title>用户端注册</title>
        <link rel="stylesheet" href="__CDN__/qz/assets/frozenui-1.3.0/css/frozen.css">
        <link rel="stylesheet" type="text/css" href="__CDN__/qz/assets/css/style.css" />
    </head>

    <body class="body loginZ">
        <section class="login_block user-zhuce-section">
            <div>
                <ul class="zhuce_list user-zhuce" id="ul">
                    <li>
                        <label for="name">真实姓名</label>
                        <input type="text" id="name" class="floatR" name="name" placeholder="真实姓名" />
                    </li>
                    <li class="borderB_none">
                        <label>选择社群</label>
                        <span class="floatR icon marginB-6">{$community.name}</span>
                    </li>
                    <li class="borderB_none">
                        <label>是否已缴纳会费</label>
                        <span class="floatR">
                            <span>
                                <input type="radio" name="radio" id="radio" value="1" checked="checked" />
                                <label for="radio" class="label"><img class="imgSrc" src="__CDN__/qz/assets/img/icon_xuanzhong.png" />是</label>
                            </span>
                            <span>
                                <input type="radio" name="radio" id="radio2" value='0' />
                                <label for="radio2" class="label"><img class="imgSrc" src="__CDN__/qz/assets/img/icon_weixuan.png" />否</label>
                            </span>
                        </span>
                    </li>
                    <li>
                        <p class="tishi_year">会员年限默认一年</p>
                        <p class="marginB49">
                            <input type="number" class="moneyJ width78_" name="fee" placeholder="请输入交费金额" /><span class="color-money">元</span>
                        </p>
                        <p>
                            <label class="inlineBlock">入会时间</label>
                            <label for="time"><img src="__CDN__/qz/assets/img/icon_ca.png" class="floatR" /></label>
                            <input type="date" id="time" class="floatR" name="entrytime" />
                        </p>
                        
                    </li>
                    <li>
                        <button type="button" class="nextBtn marginT20" id="submit">注册</button>
                    </li>
                </ul>
            </div>
        </section>
        <script type="text/javascript" src="__CDN__/qz/assets/js/jquery-1.11.3.min.js"></script>
        <script type="text/javascript">
            var paid;
            $('#ul').on('click','.label',function(){
                var radioC = $("#"+$(this).attr("for")).val();
                $('.imgSrc').attr("src",'__CDN__/qz/assets/img/icon_weixuan.png');
                $(this).find('.imgSrc').attr('src','__CDN__/qz/assets/img/icon_xuanzhong.png');
                console.warn('warn'+radioC);
                paid = $(this).find(".imgSrc").attr('value');
            })
            function toJson(str){
                var json = (new Function("return " + str))();
                return json;
            }
            $("#submit").click(function(e){
                var data = {};
                $('input').each(function(){
                    data[$(this).attr('name')] = $(this).val();
                })
                data['community_id'] = {$community.id};
                data['mobile'] = {$mobile};
                data['role'] = 2;
                $.ajax({
                    type:'post',
                    url:'{:url("index/register")}',
                    data:data,
                    success:function(result){
                        var obj = toJson(result);
                        alert(obj.msg);
                    }
                })
            });

        </script>
    </body>
</html>